import request from '@/config/axios'

export interface OrderRefundVO {
  id: number
  code: string
  orderCode: string
  status: string
  remark: string
  version: number
}

// 查询订单退款分页
export const getOrderRefundPage = async (params) => {
  return await request.get({ url: `/meijia/order-refund/page`, params })
}

// 查询订单退款详情
export const getOrderRefund = async (id: number) => {
  return await request.get({ url: `/meijia/order-refund/get?id=` + id })
}

// 新增订单退款
export const createOrderRefund = async (data: OrderRefundVO) => {
  return await request.post({ url: `/meijia/order-refund/create`, data })
}
// 申请退款
export const refundOrderFlowList = async (data: OrderRefundVO) => {
  return await request.post({ url: `/meijia/order-refund/refundOrderFlowList`, data })
}

// 修改订单退款
export const updateOrderRefund = async (data: OrderRefundVO) => {
  return await request.put({ url: `/meijia/order-refund/update`, data })
}

// 删除订单退款
export const deleteOrderRefund = async (id: number) => {
  return await request.delete({ url: `/meijia/order-refund/delete?id=` + id })
}

// 导出订单退款 Excel
export const exportOrderRefund = async (params) => {
  return await request.download({ url: `/meijia/order-refund/export-excel`, params })
}
